package com.milo.thread.create;

/**
 * @author: Milogenius
 * @create: 2019-04-19 09:09
 * @description:
 **/
public class RunnableTest implements Runnable {
    private String name;

    public RunnableTest(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            for (long k = 0; k < 100000000; k++) ;
            System.out.println(name + ": " + i);
        }
    }

    public static void main(String[] args) {
        RunnableTest ds1 = new RunnableTest("阿三");
        RunnableTest ds2 = new RunnableTest("李四");

        Thread t1 = new Thread(ds1);
        Thread t2 = new Thread(ds2);

        t1.start();
        t2.start();
    }
}
